package com.ruoyi.dgdData.service.impl;

import java.util.List;
import java.util.concurrent.Future;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.dgdData.domain.plat.DataDgdLqsh;
import com.ruoyi.dgdData.mapper.DataDgdLqshMapper;
import com.ruoyi.dgdData.service.IDataDgdLqshService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;


/**
 * 单轨吊冷却水测试数据Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-28
 */
@Service
public class DataDgdLqshServiceImpl implements IDataDgdLqshService
{
    @Autowired(required = false)
    private DataDgdLqshMapper dataDgdLqshMapper;

    /**
     * 查询单轨吊冷却水测试数据
     * 
     * @param lqshId 单轨吊冷却水测试数据主键
     * @return 单轨吊冷却水测试数据
     */
    @Override
    public DataDgdLqsh selectDataDgdLqshByLqshId(Long lqshId)
    {
        return dataDgdLqshMapper.selectDataDgdLqshByLqshId(lqshId);
    }

    /**
     * 查询单轨吊冷却水测试数据
     *
     * @param dataTaskId
     * @return 单轨吊冷却水测试数据
     */
    @Override
    public Future<List<DataDgdLqsh>> selectDataDgdLqshByDataTaskId(Long dataTaskId) {
        return new AsyncResult<>(dataDgdLqshMapper.selectDataDgdLqshByDataTaskId(dataTaskId));
    }

    /**
     * 查询单轨吊冷却水测试数据列表
     * 
     * @param dataDgdLqsh 单轨吊冷却水测试数据
     * @return 单轨吊冷却水测试数据
     */
    @Override
    public List<DataDgdLqsh> selectDataDgdLqshList(DataDgdLqsh dataDgdLqsh)
    {
        return dataDgdLqshMapper.selectDataDgdLqshList(dataDgdLqsh);
    }

    /**
     * 新增单轨吊冷却水测试数据
     * 
     * @param dataDgdLqsh 单轨吊冷却水测试数据
     * @return 结果
     */
    @Override
    public int insertDataDgdLqsh(DataDgdLqsh dataDgdLqsh)
    {
        dataDgdLqsh.setCreateTime(DateUtils.getNowDate());
        return dataDgdLqshMapper.insertDataDgdLqsh(dataDgdLqsh);
    }

    /**
     * 批量新增冷却水温度
     *
     * @param dataDgdLqshes
     */
    @Override
    public int batchDataDgdLqsh(List<DataDgdLqsh> dataDgdLqshes) {
        return dataDgdLqshMapper.batchDataDgdLqsh(dataDgdLqshes);
    }

    /**
     * 修改单轨吊冷却水测试数据
     * 
     * @param dataDgdLqsh 单轨吊冷却水测试数据
     * @return 结果
     */
    @Override
    public int updateDataDgdLqsh(DataDgdLqsh dataDgdLqsh)
    {
        dataDgdLqsh.setUpdateTime(DateUtils.getNowDate());
        return dataDgdLqshMapper.updateDataDgdLqsh(dataDgdLqsh);
    }

    /**
     * 变更单轨吊冷却水数据状态为2
     *
     * @param lqshId
     * @return 结果
     */
    @Override
    public int updateDataDgdLqshByLqshId(Long lqshId) {
        return dataDgdLqshMapper.updateDataDgdLqshByLqshId(lqshId);
    }

    /**
     * 变更单轨吊冷却水数据状态为2
     *
     * @param dataTaskId
     * @return 结果
     */
    @Override
    public int updateDataDgdLqshByDataTaskId(Long dataTaskId) {
        return dataDgdLqshMapper.updateDataDgdLqshByDataTaskId(dataTaskId);
    }

    /**
     * 批量删除单轨吊冷却水测试数据
     * 
     * @param lqshIds 需要删除的单轨吊冷却水测试数据主键
     * @return 结果
     */
    @Override
    public int deleteDataDgdLqshByLqshIds(Long[] lqshIds)
    {
        return dataDgdLqshMapper.deleteDataDgdLqshByLqshIds(lqshIds);
    }

    /**
     * 删除单轨吊冷却水测试数据信息
     * 
     * @param lqshId 单轨吊冷却水测试数据主键
     * @return 结果
     */
    @Override
    public int deleteDataDgdLqshByLqshId(Long lqshId)
    {
        return dataDgdLqshMapper.deleteDataDgdLqshByLqshId(lqshId);
    }
}
